<head>
    <meta charset="UTF-8">
<title>算法训练 画图</title>
<link rel="stylesheet" href="../css/main.css">
</head>
 <p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【问题描述】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">在一个定义了直角坐标系的纸上，画一个</span><span lang="EN-US">(x1,y1)</span><span style="font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">到</span><span lang="EN-US">(x2,y2)</span><span style="font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">的矩形指将横坐标范围从</span><span lang="EN-US">x1</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">到</span><span lang="EN-US">x2</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">，纵坐标范围从</span><span lang="EN-US">y1</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">到</span><span lang="EN-US">y2</span><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">之间的区域涂上颜色。</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">下图给出了一个画了两个矩形的例子。第一个矩形是</span><span lang="EN-US">(1,1) </span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">到</span><span lang="EN-US">(4, 4)</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">，用绿色和紫色表示。第二个矩形是</span><span lang="EN-US">(2, 3)</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">到</span><span lang="EN-US">(6, 5)</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">，用蓝色和紫色表示。图中，一共有</span><span lang="EN-US">15</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">个单位的面积被涂上颜色，其中紫色部分被涂了两次，但在计算面积时只计算一次。在实际的涂色过程中，所有的矩形都涂成统一的颜色，图中显示不同颜色仅为说明方便。</span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;"><img src="http://lx.lanqiao.cn/RequireFile.do?fid=f2GfHNjA" width="365" height="344" alt="" /></span></p>
<p class="NOI0"><span style="font-family: 宋体;">给出所有要画的矩形，请问总共有多少个单位的面积被涂上颜色。</span></p>
<p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【输入格式】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">输入的第一行包含一个整数</span><span lang="EN-US">n</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">，表示要画的矩形的个数。</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">接下来</span><span lang="EN-US">n</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">行，每行</span><span lang="EN-US">4</span><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">个非负整数，分别表示要画的矩形的左下角的横坐标与纵坐标，以及右上角的横坐标与纵坐标。</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【输出格式】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">输出一个整数，表示有多少个单位的面积被涂上颜色。</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【样例输入】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI1"><span lang="EN-US">2<o:p></o:p></span></p>
<p class="NOI1"><span lang="EN-US">1 1 4 4<o:p></o:p></span></p>
<p class="NOI1"><span lang="EN-US">2 3 6 5<o:p></o:p></span></p>
<p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【样例输出】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI1"><span lang="EN-US">15<o:p></o:p></span></p>
<p class="NOI"><span style="font-family:黑体;mso-ascii-font-family:Arial;
mso-ascii-theme-font:major-latin;mso-hansi-font-family:Arial;mso-hansi-theme-font:
major-latin">【评测用例规模与约定】</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="NOI0"><span lang="EN-US">1&lt;=n&lt;=100</span><span style="font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">，</span><span lang="EN-US">0&lt;=</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">横坐标、纵坐标</span><span lang="EN-US">&lt;=100</span><span style="font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">。</span><span lang="EN-US"><o:p></o:p></span></p>